package com.requiem.hist_group_manage_springboot.controller;

import com.requiem.hist_group_manage_springboot.exception.R;
import com.requiem.hist_group_manage_springboot.model.ManagerModel;
import com.requiem.hist_group_manage_springboot.service.LoginService;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CommonsLog
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public R login(@RequestBody ManagerModel managerModel) {
        return loginService.login(managerModel.getUsername(), managerModel.getPassword());
    }
}
